import { AmbientLight, PointLight, SpotLight } from 'three'
// import { groupPromise } from './TGroup'
// import { codeBox } from './TcodeModel'

export const lightList = []

const ambientLight = new AmbientLight('rgb(255,255,255)', 0.3) //环境光

export const pointLight = new PointLight('rgb(255,255,255)', 0.7, 100, 0.5)
pointLight.position.set(60, 20, 10)

export const spotLight = new SpotLight(
  'white',
  0.5,
  200,
  (Math.PI / 180) * 30,
  0,
  0
)
// spotLight.position.set(-50,50,-50)
spotLight.position.set(0, 200, 0)
spotLight.castShadow = true

// groupPromise.then((group) => {
//   spotLight.target = group
// })
// spotLight.target = codeBox

/**
 * 环境光与材质颜色是乘积
 * rgb(255,255,255) -> (1,1,1)
 * rgb(0,0,0) -> (0,0,0)
 */

lightList.push(ambientLight, spotLight)
